package com.beimin.evedata.model.map;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "mapconstellationjumps")
public class MapConstellationJump implements java.io.Serializable {
	private MapConstellationJumpId id;
	private MapRegion mapregionsByToRegionId;
	private MapRegion mapregionsByFromRegionId;
	private MapConstellation mapconstellationsByFromConstellationId;
	private MapConstellation mapconstellationsByToConstellationId;

	public MapConstellationJump() {
	}

	public MapConstellationJump(MapConstellationJumpId id, MapConstellation mapconstellationsByFromConstellationId, MapConstellation mapconstellationsByToConstellationId) {
		this.id = id;
		this.mapconstellationsByFromConstellationId = mapconstellationsByFromConstellationId;
		this.mapconstellationsByToConstellationId = mapconstellationsByToConstellationId;
	}

	public MapConstellationJump(MapConstellationJumpId id, MapRegion mapregionsByToRegionId, MapRegion mapregionsByFromRegionId,
			MapConstellation mapconstellationsByFromConstellationId, MapConstellation mapconstellationsByToConstellationId) {
		this.id = id;
		this.mapregionsByToRegionId = mapregionsByToRegionId;
		this.mapregionsByFromRegionId = mapregionsByFromRegionId;
		this.mapconstellationsByFromConstellationId = mapconstellationsByFromConstellationId;
		this.mapconstellationsByToConstellationId = mapconstellationsByToConstellationId;
	}

	@EmbeddedId
	@AttributeOverrides( { @AttributeOverride(name = "fromConstellationId", column = @Column(name = "fromConstellationID", nullable = false)),
			@AttributeOverride(name = "toConstellationId", column = @Column(name = "toConstellationID", nullable = false)) })
	public MapConstellationJumpId getId() {
		return this.id;
	}

	public void setId(MapConstellationJumpId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "toRegionID")
	public MapRegion getMapregionsByToRegionId() {
		return this.mapregionsByToRegionId;
	}

	public void setMapregionsByToRegionId(MapRegion mapregionsByToRegionId) {
		this.mapregionsByToRegionId = mapregionsByToRegionId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "fromRegionID")
	public MapRegion getMapregionsByFromRegionId() {
		return this.mapregionsByFromRegionId;
	}

	public void setMapregionsByFromRegionId(MapRegion mapregionsByFromRegionId) {
		this.mapregionsByFromRegionId = mapregionsByFromRegionId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "fromConstellationID", nullable = false, insertable = false, updatable = false)
	public MapConstellation getMapconstellationsByFromConstellationId() {
		return this.mapconstellationsByFromConstellationId;
	}

	public void setMapconstellationsByFromConstellationId(MapConstellation mapconstellationsByFromConstellationId) {
		this.mapconstellationsByFromConstellationId = mapconstellationsByFromConstellationId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "toConstellationID", nullable = false, insertable = false, updatable = false)
	public MapConstellation getMapconstellationsByToConstellationId() {
		return this.mapconstellationsByToConstellationId;
	}

	public void setMapconstellationsByToConstellationId(MapConstellation mapconstellationsByToConstellationId) {
		this.mapconstellationsByToConstellationId = mapconstellationsByToConstellationId;
	}

}
